<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Form 表单 | 组件文档</title>
    <meta name="description" content="组件文档">
    <link rel="stylesheet" href="/q-admin-design-vue/document/assets/style.abb96c2a.css">
    <link rel="modulepreload" href="/q-admin-design-vue/document/assets/app.6f72a453.js">
    <link rel="modulepreload" href="/q-admin-design-vue/document/assets/pages_form.md.0f08d4ff.lean.js">
    
    <link rel="icon" type="image/svg+xml" href="images/logo.svg">
  <script id="check-dark-light">(()=>{const e=localStorage.getItem("vitepress-theme-appearance"),a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-5d544efb><!--[--><!--]--><!--[--><span tabindex="-1" data-v-b399dc10></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-b399dc10> Skip to content </a><!--]--><!----><header class="VPNav" data-v-5d544efb data-v-cf59daee><div class="VPNavBar has-sidebar" data-v-cf59daee data-v-61ad995e><div class="container" data-v-61ad995e><div class="VPNavBarTitle has-sidebar" data-v-61ad995e data-v-1083287f><a class="title" href="/q-admin-design-vue/document/" data-v-1083287f><!--[--><!--]--><!--[--><img class="VPImage logo" src="/q-admin-design-vue/document/images/logo.svg" data-v-51b7c67c><!--]--><!--[-->组件文档<!--]--><!--[--><!--]--></a></div><div class="content" data-v-61ad995e><!--[--><!--]--><!----><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-61ad995e data-v-28c86539><span id="main-nav-aria-label" class="visually-hidden" data-v-28c86539>Main Navigation</span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/q-admin-design-vue/document/" data-v-28c86539 data-v-d91d9e03 data-v-7a7aafc7><!--[-->主页<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/q-admin-design-vue/document/pages/install.html" data-v-28c86539 data-v-d91d9e03 data-v-7a7aafc7><!--[-->指南<!--]--><!----></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/q-admin-design-vue/document/pages/updateLog.html" data-v-28c86539 data-v-d91d9e03 data-v-7a7aafc7><!--[-->更新日志<!--]--><!----></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-61ad995e data-v-f378d770><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-label="toggle dark mode" aria-checked="false" data-v-f378d770 data-v-61fb31e0 data-v-f97b261d><span class="check" data-v-f97b261d><span class="icon" data-v-f97b261d><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-61fb31e0><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-61fb31e0><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div><!----><div class="VPFlyout VPNavBarExtra extra" data-v-61ad995e data-v-1756ccba data-v-19603d61><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-19603d61><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="icon" data-v-19603d61><circle cx="12" cy="12" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="5" cy="12" r="2"></circle></svg></button><div class="menu" data-v-19603d61><div class="VPMenu" data-v-19603d61 data-v-3b9474d7><!----><!--[--><!--[--><!----><div class="group" data-v-1756ccba><div class="item appearance" data-v-1756ccba><p class="label" data-v-1756ccba>Appearance</p><div class="appearance-action" data-v-1756ccba><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" aria-label="toggle dark mode" aria-checked="false" data-v-1756ccba data-v-61fb31e0 data-v-f97b261d><span class="check" data-v-f97b261d><span class="icon" data-v-f97b261d><!--[--><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="sun" data-v-61fb31e0><path d="M12,18c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S15.3,18,12,18zM12,8c-2.2,0-4,1.8-4,4c0,2.2,1.8,4,4,4c2.2,0,4-1.8,4-4C16,9.8,14.2,8,12,8z"></path><path d="M12,4c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,3.6,12.6,4,12,4z"></path><path d="M12,24c-0.6,0-1-0.4-1-1v-2c0-0.6,0.4-1,1-1s1,0.4,1,1v2C13,23.6,12.6,24,12,24z"></path><path d="M5.6,6.6c-0.3,0-0.5-0.1-0.7-0.3L3.5,4.9c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C6.2,6.5,5.9,6.6,5.6,6.6z"></path><path d="M19.8,20.8c-0.3,0-0.5-0.1-0.7-0.3l-1.4-1.4c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l1.4,1.4c0.4,0.4,0.4,1,0,1.4C20.3,20.7,20,20.8,19.8,20.8z"></path><path d="M3,13H1c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S3.6,13,3,13z"></path><path d="M23,13h-2c-0.6,0-1-0.4-1-1s0.4-1,1-1h2c0.6,0,1,0.4,1,1S23.6,13,23,13z"></path><path d="M4.2,20.8c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C4.7,20.7,4.5,20.8,4.2,20.8z"></path><path d="M18.4,6.6c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l1.4-1.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-1.4,1.4C18.9,6.5,18.6,6.6,18.4,6.6z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="moon" data-v-61fb31e0><path d="M12.1,22c-0.3,0-0.6,0-0.9,0c-5.5-0.5-9.5-5.4-9-10.9c0.4-4.8,4.2-8.6,9-9c0.4,0,0.8,0.2,1,0.5c0.2,0.3,0.2,0.8-0.1,1.1c-2,2.7-1.4,6.4,1.3,8.4c2.1,1.6,5,1.6,7.1,0c0.3-0.2,0.7-0.3,1.1-0.1c0.3,0.2,0.5,0.6,0.5,1c-0.2,2.7-1.5,5.1-3.6,6.8C16.6,21.2,14.4,22,12.1,22zM9.3,4.4c-2.9,1-5,3.6-5.2,6.8c-0.4,4.4,2.8,8.3,7.2,8.7c2.1,0.2,4.2-0.4,5.8-1.8c1.1-0.9,1.9-2.1,2.4-3.4c-2.5,0.9-5.3,0.5-7.5-1.1C9.2,11.4,8.1,7.7,9.3,4.4z"></path></svg><!--]--></span></span></button></div></div></div><!----><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-61ad995e data-v-db38c037><span class="container" data-v-db38c037><span class="top" data-v-db38c037></span><span class="middle" data-v-db38c037></span><span class="bottom" data-v-db38c037></span></span></button></div></div></div><!----></header><div class="VPLocalNav" data-v-5d544efb data-v-63710b2a><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-63710b2a><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" viewbox="0 0 24 24" class="menu-icon" data-v-63710b2a><path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z"></path><path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z"></path><path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z"></path><path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z"></path></svg><span class="menu-text" data-v-63710b2a>Menu</span></button><a class="top-link" href="#" data-v-63710b2a> Return to top </a></div><aside class="VPSidebar" data-v-5d544efb data-v-c08caa19><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-c08caa19><span class="visually-hidden" id="sidebar-aria-label" data-v-c08caa19> Sidebar Navigation </span><!--[--><div class="group" data-v-c08caa19><section class="VPSidebarGroup collapsible" data-v-c08caa19 data-v-ad3d630b><div class="title" role="button" data-v-ad3d630b><h2 class="title-text" data-v-ad3d630b>开发指南</h2><div class="action" data-v-ad3d630b><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 24 24" class="icon minus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2zM20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h8c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg><svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon plus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2z M20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11h-3V8c0-0.6-0.4-1-1-1s-1,0.4-1,1v3H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h3v3c0,0.6,0.4,1,1,1s1-0.4,1-1v-3h3c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg></div></div><div class="items" data-v-ad3d630b><!--[--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/install.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>安装</span><!--]--><!----></a><!----><!--]--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/quickstart.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>快速开始</span><!--]--><!----></a><!----><!--]--><!--]--></div></section></div><div class="group" data-v-c08caa19><section class="VPSidebarGroup collapsible" data-v-c08caa19 data-v-ad3d630b><div class="title" role="button" data-v-ad3d630b><h2 class="title-text" data-v-ad3d630b>功能组件</h2><div class="action" data-v-ad3d630b><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 24 24" class="icon minus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2zM20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h8c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg><svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon plus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2z M20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11h-3V8c0-0.6-0.4-1-1-1s-1,0.4-1,1v3H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h3v3c0,0.6,0.4,1,1,1s1-0.4,1-1v-3h3c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg></div></div><div class="items" data-v-ad3d630b><!--[--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/q-multiple-select-check-box.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>checkbox多选 选择器</span><!--]--><!----></a><!----><!--]--><!--]--></div></section></div><div class="group" data-v-c08caa19><section class="VPSidebarGroup collapsible" data-v-c08caa19 data-v-ad3d630b><div class="title" role="button" data-v-ad3d630b><h2 class="title-text" data-v-ad3d630b>列表组件</h2><div class="action" data-v-ad3d630b><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 24 24" class="icon minus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2zM20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h8c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg><svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon plus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2z M20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11h-3V8c0-0.6-0.4-1-1-1s-1,0.4-1,1v3H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h3v3c0,0.6,0.4,1,1,1s1-0.4,1-1v-3h3c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg></div></div><div class="items" data-v-ad3d630b><!--[--><!--[--><a class="VPLink link link active" href="/q-admin-design-vue/document/pages/form.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>表单组件</span><!--]--><!----></a><!----><!--]--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/dialog-form.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>弹框表单组件</span><!--]--><!----></a><!----><!--]--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/q-search.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>列表查询组件</span><!--]--><!----></a><!----><!--]--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/q-table.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>列表组件</span><!--]--><!----></a><!----><!--]--><!--]--></div></section></div><div class="group" data-v-c08caa19><section class="VPSidebarGroup collapsible" data-v-c08caa19 data-v-ad3d630b><div class="title" role="button" data-v-ad3d630b><h2 class="title-text" data-v-ad3d630b>弹窗类组件</h2><div class="action" data-v-ad3d630b><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 24 24" class="icon minus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2zM20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h8c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg><svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon plus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2z M20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11h-3V8c0-0.6-0.4-1-1-1s-1,0.4-1,1v3H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h3v3c0,0.6,0.4,1,1,1s1-0.4,1-1v-3h3c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg></div></div><div class="items" data-v-ad3d630b><!--[--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/dialog.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>弹窗组件</span><!--]--><!----></a><!----><!--]--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/q-icon-confirm.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>确认弹窗组件</span><!--]--><!----></a><!----><!--]--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/q-confirm.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>确认弹窗组件(无icon)</span><!--]--><!----></a><!----><!--]--><!--]--></div></section></div><div class="group" data-v-c08caa19><section class="VPSidebarGroup collapsible" data-v-c08caa19 data-v-ad3d630b><div class="title" role="button" data-v-ad3d630b><h2 class="title-text" data-v-ad3d630b>图片类组件</h2><div class="action" data-v-ad3d630b><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 24 24" class="icon minus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2zM20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h8c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg><svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon plus" data-v-ad3d630b><path d="M19,2H5C3.3,2,2,3.3,2,5v14c0,1.7,1.3,3,3,3h14c1.7,0,3-1.3,3-3V5C22,3.3,20.7,2,19,2z M20,19c0,0.6-0.4,1-1,1H5c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h14c0.6,0,1,0.4,1,1V19z"></path><path d="M16,11h-3V8c0-0.6-0.4-1-1-1s-1,0.4-1,1v3H8c-0.6,0-1,0.4-1,1s0.4,1,1,1h3v3c0,0.6,0.4,1,1,1s1-0.4,1-1v-3h3c0.6,0,1-0.4,1-1S16.6,11,16,11z"></path></svg></div></div><div class="items" data-v-ad3d630b><!--[--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/q-upload.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>Upload 上传</span><!--]--><!----></a><!----><!--]--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/q-svga.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>Svga 图片</span><!--]--><!----></a><!----><!--]--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/q-image.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>Image 图片</span><!--]--><!----></a><!----><!--]--><!--[--><a class="VPLink link link" href="/q-admin-design-vue/document/pages/q-image-preview.html" style="padding-left:0px;" data-v-887ba7c7 data-v-7a7aafc7><!--[--><span class="link-text" data-v-887ba7c7>ImagePreview 图片</span><!--]--><!----></a><!----><!--]--><!--]--></div></section></div><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d544efb data-v-a13efced><div class="VPDoc has-sidebar has-aside" data-v-a13efced data-v-9176979b><div class="container" data-v-9176979b><div class="aside" data-v-9176979b><div class="aside-curtain" data-v-9176979b></div><div class="aside-container" data-v-9176979b><div class="aside-content" data-v-9176979b><div class="VPDocAside" data-v-9176979b data-v-ce7fdad2><!--[--><!--]--><!--[--><!--]--><div class="VPDocAsideOutline" data-v-ce7fdad2 data-v-96abcd72><div class="content" data-v-96abcd72><div class="outline-marker" data-v-96abcd72></div><div class="outline-title" data-v-96abcd72>On this page</div><nav aria-labelledby="doc-outline-aria-label" data-v-96abcd72><span class="visually-hidden" id="doc-outline-aria-label" data-v-96abcd72> Table of Contents for current page </span><ul class="root" data-v-96abcd72 data-v-7823071e><!--[--><!--]--></ul></nav></div></div><!--[--><!--]--><div class="spacer" data-v-ce7fdad2></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-9176979b><div class="content-container" data-v-9176979b><!--[--><!--]--><main class="main" data-v-9176979b><div style="position:relative;" class="vp-doc _q-admin-design-vue_document_pages_form" data-v-9176979b><div><h1 id="form-表单" tabindex="-1">Form 表单 <a class="header-anchor" href="#form-表单" aria-hidden="true">#</a></h1><p>用户快速构建表单，表单包含 <code>输入框</code>, <code>单选框</code>, <code>下拉选择</code>, <code>多选框</code> 等用户输入的组件。 使用表单，您可以收集、验证和提交数据。</p><h2 id="行内表单" tabindex="-1">行内表单 <a class="header-anchor" href="#行内表单" aria-hidden="true">#</a></h2><p>通过设置 inline 属性为 true 可以让表单域变为行内的表单域。</p><!----><h2 id="垂直方向表单" tabindex="-1">垂直方向表单 <a class="header-anchor" href="#垂直方向表单" aria-hidden="true">#</a></h2><p>inline 属性默认为 false 垂直方向。</p><!----><h2 id="表单默认值-回显" tabindex="-1">表单默认值/回显 <a class="header-anchor" href="#表单默认值-回显" aria-hidden="true">#</a></h2><p>通过给 formModelValues 对象设置属性填充 需要和 key 属性字段保持一致。</p><!----><h2 id="表单验证" tabindex="-1">表单验证 <a class="header-anchor" href="#表单验证" aria-hidden="true">#</a></h2><p>Form 组件提供了表单验证的功能，只需为 rules 属性传入约定的验证规则。<code>规则和element-plus一致</code></p><!----><h2 id="表单使用全量模版" tabindex="-1">表单使用全量模版 <a class="header-anchor" href="#表单使用全量模版" aria-hidden="true">#</a></h2><p>包含几乎所有的配置，可以直接复制修改</p><!----><h2 id="表单-api" tabindex="-1">表单 API <a class="header-anchor" href="#表单-api" aria-hidden="true">#</a></h2><h3 id="form-属性" tabindex="-1">Form 属性 <a class="header-anchor" href="#form-属性" aria-hidden="true">#</a></h3><table><thead><tr><th>属性名</th><th style="text-align:center;">说明</th><th style="text-align:right;">类型</th><th style="text-align:right;">默认值</th></tr></thead><tbody><tr><td><code>v-model</code></td><td style="text-align:center;">绑定值</td><td style="text-align:right;"><code>Record&lt;string, any&gt;</code></td><td style="text-align:right;">—</td></tr><tr><td><code>handlerSubmit</code></td><td style="text-align:center;"><code>*必须</code> <code>Function</code>表单提交</td><td style="text-align:right;"><code>(formModels: object) =&gt; Promise&lt;any&gt;</code></td><td style="text-align:right;"></td></tr><tr><td><code>formConfigList</code></td><td style="text-align:center;"><code>*必须</code> 表单模型</td><td style="text-align:right;"><code>Record&lt;string, any&gt;</code></td><td style="text-align:right;">—</td></tr><tr><td><code>inline</code></td><td style="text-align:center;">行内表单模式</td><td style="text-align:right;"><code>boolean</code></td><td style="text-align:right;"><code>false</code></td></tr><tr><td><code>label-position</code></td><td style="text-align:center;">表单域标签的位置， 当设置为 <code>left</code> 或 <code>right</code> 时，则也需要设置 <code>label-width</code> 属性</td><td style="text-align:right;"><code>left | right | top</code></td><td style="text-align:right;"><code>right</code></td></tr><tr><td><code>label-width</code></td><td style="text-align:center;">标签的长度，例如 <code>&#39;50px&#39;</code>。 作为 Form 直接子元素的 form-item 会继承该值。 可以使用 <code>auto</code>。</td><td style="text-align:right;"><code>string | number</code></td><td style="text-align:right;">—</td></tr><tr><td><code>isAsterisk</code></td><td style="text-align:center;">是否隐藏必填字段标签旁边的红色星号</td><td style="text-align:right;"><code>boolean</code></td><td style="text-align:right;"><code>true</code></td></tr><tr><td><code>size</code></td><td style="text-align:center;">用于控制该表单内组件的尺寸</td><td style="text-align:right;"><code>large | default | small</code></td><td style="text-align:right;">—</td></tr><tr><td><code>globalDisabled</code></td><td style="text-align:center;">是否禁用该表单内的所有组件。 如果设置为 <code>true</code>, 它将覆盖内部组件的 <code>disabled</code> 属性</td><td style="text-align:right;"><code>boolean</code></td><td style="text-align:right;"><code>false</code></td></tr><tr><td><code>confirmButtonText</code></td><td style="text-align:center;">确认按钮文字</td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;"><code>提交</code></td></tr><tr><td><code>cancelButtonText</code></td><td style="text-align:center;">取消按钮文字</td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;"><code>重置</code></td></tr><tr><td><code>formModelValues</code></td><td style="text-align:center;">回显的数据，会覆盖<code>formConfigList</code>的<code>defaultValue</code>属性</td><td style="text-align:right;"><code>Record&lt;string, any&gt;</code></td><td style="text-align:right;">—</td></tr><tr><td><code>handlerUpload</code></td><td style="text-align:center;"><code>Function</code>文件上传</td><td style="text-align:right;"><code>(file: File, formConfig: FormConfigType) =&gt; Promise&lt;any&gt;</code></td><td style="text-align:right;"></td></tr><tr><td><code>resetForm</code></td><td style="text-align:center;"><code>Function</code>表单重置回调</td><td style="text-align:right;"><code>() =&gt; void</code></td><td style="text-align:right;"></td></tr></tbody></table><h2 id="表单模型" tabindex="-1">表单模型 <a class="header-anchor" href="#表单模型" aria-hidden="true">#</a></h2><h3 id="formconfiglist-属性" tabindex="-1">formConfigList 属性 <a class="header-anchor" href="#formconfiglist-属性" aria-hidden="true">#</a></h3><table><thead><tr><th>属性名</th><th style="text-align:center;">说明</th><th style="text-align:right;">类型</th><th style="text-align:right;">默认值</th></tr></thead><tbody><tr><td><code>componentType</code></td><td style="text-align:center;"><code>*必须</code> 表单项大类型</td><td style="text-align:right;"><code>text |sms |switch | checkbox | radio | stepper | rate | slider | select | date| uploader</code></td><td style="text-align:right;">—</td></tr><tr><td><code>type</code></td><td style="text-align:center;">表单项分类型</td><td style="text-align:right;">text/textarea/password/year/month/date/dates/datetime/ week/datetimerange/daterange/ monthrange</td><td style="text-align:right;"><code>text</code></td></tr><tr><td><code>key</code></td><td style="text-align:center;"><code>*必须</code></td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;">—</td></tr><tr><td><code>defaultValue</code></td><td style="text-align:center;">默认值</td><td style="text-align:right;"><code>any</code></td><td style="text-align:right;">—</td></tr><tr><td><code>rules</code></td><td style="text-align:center;">表单验证规则, 同步<code>element-plus</code></td><td style="text-align:right;"><code>FormItemRule / FormItemRule[]</code></td><td style="text-align:right;">—</td></tr><tr><td><code>label</code></td><td style="text-align:center;">标签文本</td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;">—</td></tr><tr><td><code>visible</code></td><td style="text-align:center;">是否隐藏<code>false展示</code></td><td style="text-align:right;"><code>boolean</code></td><td style="text-align:right;"><code>false</code></td></tr><tr><td><code>maxlength</code></td><td style="text-align:center;">最大输入长度</td><td style="text-align:right;"><code>number</code></td><td style="text-align:right;">—</td></tr><tr><td><code>placeholder</code></td><td style="text-align:center;">输入框占位文本</td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;">—</td></tr><tr><td><code>disabled</code></td><td style="text-align:center;">是否禁用</td><td style="text-align:right;"><code>boolean</code></td><td style="text-align:right;"><code>false</code></td></tr><tr><td><code>showPassword</code></td><td style="text-align:center;">是否显示切换密码图标</td><td style="text-align:right;"><code>boolean</code></td><td style="text-align:right;"><code>false</code></td></tr><tr><td><code>suffixIcon</code></td><td style="text-align:center;">自定义后缀图标</td><td style="text-align:right;"><code>string | Component</code></td><td style="text-align:right;">—</td></tr><tr><td><code>prefixIcon</code></td><td style="text-align:center;">自定义前缀图标</td><td style="text-align:right;"><code>string | Component</code></td><td style="text-align:right;">—</td></tr><tr><td><code>showWordLimit</code></td><td style="text-align:center;">是否显示统计字数, 只在 <code>type</code> 为 &#39;text&#39; 或 &#39;textarea&#39; 的时候生效</td><td style="text-align:right;"><code>boolean</code></td><td style="text-align:right;"><code>false</code></td></tr><tr><td><code>rows</code></td><td style="text-align:center;">输入框行数，仅 <code>type</code> 为 &#39;textarea&#39; 时有效</td><td style="text-align:right;"><code>number</code></td><td style="text-align:right;"><code>2</code></td></tr><tr><td><code>autosize</code></td><td style="text-align:center;">textarea 高度是否自适应，仅 type 为 &#39;textarea&#39; 时生效。 可以接受一个对象，比如: <code>{ minRows: 2, maxRows: 6 }</code></td><td style="text-align:right;"><code>boolean / object</code></td><td style="text-align:right;"><code>false</code></td></tr><tr><td><code>dateFormat</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;date&#39; 时有效 日期格式化</td><td style="text-align:right;"><code>YYYY-MM-DD | YYYY-MM-DD HH:mm:ss</code></td><td style="text-align:right;">—</td></tr><tr><td><code>startPlaceholder</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;date&#39; 时有效 输入框占位文本</td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;">请选择开始日期</td></tr><tr><td><code>endPlaceholder</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;date&#39; 时有效 输入框占位文本</td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;">请选择结束日期</td></tr><tr><td><code>separator</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;date&#39; 时有效 选择范围时的分隔符</td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;">-</td></tr><tr><td><code>shortcuts</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;date&#39; 时有效 设置快捷选项，需要传入数组对象</td><td style="text-align:right;"><code>Array&lt;{ text: string, value: Date \ Function }&gt;</code></td><td style="text-align:right;">-</td></tr><tr><td><code>disabledDate</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;date&#39; 时有效 一个用来判断该日期是否被禁用的函数，接受一个 Date 对象作为参数。 应该返回一个 Boolean 值。</td><td style="text-align:right;"><code>(time: Date) =&gt; boolean</code></td><td style="text-align:right;">-</td></tr><tr><td><code>options</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;select&#39; 时有效 选择项</td><td style="text-align:right;"><code>Array&lt;{label:string,value:string / number}&gt;</code></td><td style="text-align:right;">-</td></tr><tr><td><code>remote</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;select&#39; 时有效 远程搜索</td><td style="text-align:right;"><code>boolean</code></td><td style="text-align:right;"><code>false</code></td></tr><tr><td><code>confirmCallback</code></td><td style="text-align:center;"><code>Function</code>仅 <code>componentType</code> 为 &#39;select&#39; 时有效 选择的回调</td><td style="text-align:right;"><code>confirmCallback(formModel: any,formModels: any,opt: any,formConfigList?): void</code></td><td style="text-align:right;">-</td></tr><tr><td><code>min</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;stepper</td><td style="text-align:right;">rate&#39;时有效 最小值</td><td style="text-align:right;"><code>number</code></td></tr><tr><td><code>max</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;stepper</td><td style="text-align:right;">rate&#39;时有效 最大值</td><td style="text-align:right;"><code>number</code></td></tr><tr><td><code>multiple</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;uploader&#39;时有效 是否支持多选文件</td><td style="text-align:right;"><code>boolean</code></td><td style="text-align:right;"><code>false</code></td></tr><tr><td><code>accept</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;uploader&#39;时有效 上传的类型</td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;"><code>image/*</code></td></tr><tr><td><code>maxCount</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;uploader&#39;时有效 允许上传文件的最大数量</td><td style="text-align:right;"><code>number</code></td><td style="text-align:right;"><code>1</code></td></tr><tr><td><code>tip</code></td><td style="text-align:center;">仅 <code>componentType</code> 为 &#39;uploader&#39;时有效 提示</td><td style="text-align:right;"><code>string</code></td><td style="text-align:right;">-</td></tr></tbody></table><h2 id="插槽" tabindex="-1">插槽 <a class="header-anchor" href="#插槽" aria-hidden="true">#</a></h2><table><thead><tr><th>名称</th><th style="text-align:center;">描述</th><th style="text-align:right;">Scope</th></tr></thead><tbody><tr><td><code>key</code></td><td style="text-align:center;">formConfigList的key就是插槽名称，每一项就是row</td><td style="text-align:right;"><code>{row:formConfigListItem}</code></td></tr></tbody></table></div></div></main><!--[--><!--]--><footer class="VPDocFooter" data-v-9176979b data-v-843c7219><div class="edit-info" data-v-843c7219><!----><div class="last-updated" data-v-843c7219><p class="VPLastUpdated" data-v-843c7219 data-v-41cc8af7>上次更新: <time datatime="2022-11-25T02:09:59.000Z" data-v-41cc8af7></time></p></div></div><div class="prev-next" data-v-843c7219><div class="pager" data-v-843c7219><a class="pager-link prev" href="/q-admin-design-vue/document/pages/q-multiple-select-check-box.html" data-v-843c7219><span class="desc" data-v-843c7219>Previous page</span><span class="title" data-v-843c7219>checkbox多选 选择器</span></a></div><div class="has-prev pager" data-v-843c7219><a class="pager-link next" href="/q-admin-design-vue/document/pages/dialog-form.html" data-v-843c7219><span class="desc" data-v-843c7219>Next page</span><span class="title" data-v-843c7219>弹框表单组件</span></a></div></div></footer><!--[--><!--]--></div></div></div></div></div><!----><!--[--><!--]--></div></div>
    <script>__VP_HASH_MAP__ = JSON.parse("{\"index.md\":\"4d32bfc2\",\"pages_dialog-form.md\":\"8c5c0835\",\"pages_dialog.md\":\"b72c9f8b\",\"pages_form.md\":\"0f08d4ff\",\"pages_install.md\":\"a1728730\",\"pages_q-confirm.md\":\"b77f13c6\",\"pages_q-icon-confirm.md\":\"a254a61f\",\"pages_q-image-preview.md\":\"5d80099a\",\"pages_q-image.md\":\"ab71bbc0\",\"pages_q-multiple-select-check-box.md\":\"bf4df8a0\",\"pages_q-search.md\":\"ef99f787\",\"pages_q-svga.md\":\"6a653ddb\",\"pages_q-table.md\":\"c911f647\",\"pages_q-upload.md\":\"db92ab90\",\"pages_quickstart.md\":\"e2b7dee8\",\"pages_table.md\":\"6aa0c557\",\"pages_updatelog.md\":\"a0cde73a\"}")</script>
    <script type="module" async src="/q-admin-design-vue/document/assets/app.6f72a453.js"></script>
    
  </body>
</html>